﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace STF.Blog.WebApp.Areas.ForumManage.Filters
{
    public class LoginAttribute:ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext context)
        {

            var res = context.HttpContext.Session.GetString("LoginYes") != null ? false : true;
            if (res)
                context.HttpContext.Response.Redirect("../../ForumManage/Login/SignIn");

            base.OnActionExecuting(context);
        }
    }
}
